package com.isunland.managesystem.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.base.BaseVolleyActivity;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/3/15 11:29
 */
public class SelectLocationMapActivity extends SingleFragmentActivity {
  private String mAddress;
  private String mRegionX;
  private String mRegionY;

  public static void newInstance(android.support.v4.app.Fragment fragment,
      BaseVolleyActivity context, int requestCode, String mWorkAddress, String mRegionX,
      String mRegionY) {

    if (fragment == null || context == null) return;
    Intent intent = new Intent(context, SelectLocationMapActivity.class);
    intent.putExtra(SelectLocationMapFragment.EXTRA_ADDRESS, mWorkAddress);
    intent.putExtra(SelectLocationMapFragment.EXTRA_LAT, mRegionX);
    intent.putExtra(SelectLocationMapFragment.EXTRA_LON, mRegionY);
    fragment.startActivityForResult(intent, requestCode);
  }

  @Override public void onCreate(Bundle arg0) {
    mAddress = getIntent().getStringExtra(SelectLocationMapFragment.EXTRA_ADDRESS);
    mRegionX = getIntent().getStringExtra(SelectLocationMapFragment.EXTRA_LAT);
    mRegionY = getIntent().getStringExtra(SelectLocationMapFragment.EXTRA_LON);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragment() {
    return SelectLocationMapFragment.newInstance(mAddress, mRegionX, mRegionY);
  }
}
